#include "stdafx.h"
#include "CodeLib.h"
#include "../Register/RegHelper.h"
#include "../Http/HttpHelper.h"
#include "../Http/AsyncWinHttp1.h"
typedef void ( *DownCallback )( LPVOID pParam, DWORD dwStatus, DWORD dwDownloaded, DWORD dwTotal );

BOOL RegGetBool( HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue, BOOL& bValue )
{
    return CODEHELPER::CRegHelper::GetBool( hkey, pszSubKey, pszValue, bValue );
}

BOOL RegSetBool( HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue, BOOL bValue )
{
    return CODEHELPER::CRegHelper::SetBool( hkey, pszSubKey, pszValue, bValue );
}

BOOL RegGetDword( HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue, DWORD& dwValue )
{
    return CODEHELPER::CRegHelper::GetDword( hkey, pszSubKey, pszValue, dwValue );
}
BOOL RegSetDword( HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue, DWORD dwValue )
{
    return CODEHELPER::CRegHelper::SetDword( hkey, pszSubKey, pszValue, dwValue );
}

BOOL RegGetString( HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue, LPTSTR lpszValue, DWORD dwSize )
{
    return CODEHELPER::CRegHelper::GetString( hkey, pszSubKey, pszValue, lpszValue, dwSize );
}

BOOL RegSetString( HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue, LPCTSTR lpszValue )
{
    return CODEHELPER::CRegHelper::SetString( hkey, pszSubKey, pszValue, lpszValue );
}

BOOL RegDelKeyValue( HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue )
{
    return CODEHELPER::CRegHelper::DelKeyValue( hkey, pszSubKey, pszValue );
}

BOOL IsKeyExist( HKEY hkey, LPCTSTR pszSubKey )
{
    return CODEHELPER::CRegHelper::IsKeyExist( hkey, pszSubKey );
}

BOOL IsHasNetConnect()
{
    return CODEHELPER::CHttpHelper::IsHasNetConnect();
}

BOOL OpenUrlWithIE( LPCTSTR lpszURL )
{
    return CODEHELPER::CHttpHelper::OpenUrlWithIE( lpszURL );
}

BOOL DownloadFile( LPCTSTR lpszUrl, LPCTSTR lpszSavePath, LPCVOID lpCallback, LPVOID pParam )
{
    CODEHELPER::CDownload* pDown = new CODEHELPER::CDownload( lpszUrl, lpszSavePath );
    pDown->SetCallBack( ( DownCallback )lpCallback, pDown );
    BOOL bRet = pDown->SendRequest();
// 	CODEHELPER::CDownload download(lpszUrl,lpszSavePath);
// 	BOOL bRet=download.SendRequest();
    return bRet;
}
